package top.sqdpt.rag.tools;

import dev.langchain4j.agent.tool.Tool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import top.sqdpt.third.entity.dto.WeatherResponseDTO;
import top.sqdpt.third.enums.WeatherQueryType;
import top.sqdpt.third.service.WeatherService;

import java.util.List;

@Component
public class WeatherTool {

    @Autowired
    WeatherService weatherService;


    @Tool(name = "天气查询", value = "查询某个城市的天气。可以通过weatherQueryType的值查询实时天气，或者3/5/7/10/15/30天的天气预报。")
    public List<WeatherResponseDTO> queryWeather(WeatherQueryType weatherQueryType, String address, String city) {
        return weatherService.queryWeather(weatherQueryType, address, city);
    }

}
